package com.u.finance.call.mq;

import com.alibaba.fastjson.JSON;
import com.u.finance.call.entity.RepaymentSchedule;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;

/**
 * @program: u-finance
 * @description: 还款消息监听类
 * @author: Alex Wu
 * @createDate: 2025-03-31 16:58
 **/
@RocketMQMessageListener( topic = "repay-topic",consumerGroup = "repay-topic-group")
public class RePayConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String msg) {

        System.out.println("还款消息监听类:"+msg);
        RepaymentSchedule repaymentSchedule = JSON.parseObject(msg, RepaymentSchedule.class);
        repaymentSchedule.setStatus("已还款");
        System.out.println("还款消息监听类:"+repaymentSchedule);
    }
}
